$(function(){
    history.pushState(null, null, document.URL);
    window.addEventListener('popstate', function () {
        history.pushState(null, null, document.URL);
    });
    window.Interface.challengeNum({},function(res){
        if(!res.open){
            showPop("擂台挑战已经结束，请您返回活动首页查看排行榜及参加幸运抽奖","确定","");
        }
        $("#challenge-parenting").text(res.child);
        $("#challenge-disport").text(res.fun);
        $("#challenge-game").text(res.game);
        $("#challenge-money").text(res.finance);
        $("#challenge-life").text(res.life);
        $("#challenge-health").text(res.healthy);
    });

//进入星球埋点
window.Interface.tracking('活动详情页', '参加挑战', '')


$(".ball-box a").on("click",function(e){
    //e.preventDefault();
    if(parseInt($(this).find("i").text()) >=3  &&  $(this).find("#challenge-game").length < 1){
        showPop("每天最多挑战3次哟，去试试其他项目吧！","确定","");
    }else{
        window.location.href= $(this).attr("rel");
    }
    var rel = $(this).attr("rel");
switch (rel)
  {
  case "disport.html":
    window.Interface.tracking('六大星球主页', '娱乐星球', '')
    break;
  case "parenting.html":
    window.Interface.tracking('六大星球主页', '育儿星球', '')
    break;
  case "game.html?v6":
    window.Interface.tracking('六大星球主页', '游戏星球', '')
    break;
  case "money.html":
    window.Interface.tracking('六大星球主页', '理财星球', '')
    break;
  case "life.html":
    window.Interface.tracking('六大星球主页', '生活星球', '')
    break;
  case "health.html":
    window.Interface.tracking('六大星球主页', '健康星球', '')
    break;
  }

});



});






